//引入axios
import request from '@/utils/request';
enum API {
    //获取SKU列表接口
    SKUURL = "/admin/product/list/",
    UPDATELIST = '/admin/product/onSale/',
    DOWNLIST = '/admin/product/cancelSale/',
    //通过SKU的ID获取详情
    SKUINFO = "/admin/product/getSkuById/",
    //删除SKU接口
    DELETESKU = "/admin/product/deleteSku/"
}
//获取SKU列表
export const reqSkuList = (page: number, limit: number) => request.get(API.SKUURL + `${page}/${limit}`);
//上架
export const reqUpdateList = (skuId: number) => request.get(API.UPDATELIST + skuId);
//下架
export const reqDownList = (skuId: number) => request.get(API.DOWNLIST + skuId);
//获取SKU详情的数据通过抽屉展示
export const reqSkuInfo = (skuId: number) => request.get(API.SKUINFO + skuId);
//删除SKU的业务
export const reqDeleteSku = (skuId: number) => request.delete(API.DELETESKU + skuId);